package com.zxl.shop08home;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.session.config.annotation.web.http.EnableSpringHttpSession;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

@SpringBootApplication(scanBasePackages = "com.zxl")
@EnableEurekaClient
@EnableFeignClients(basePackages = "com.zxl.feign")
@EnableRedisHttpSession
public class Shop08HomeApplication {

    public static void main(String[] args) {
        SpringApplication.run(Shop08HomeApplication.class, args);
    }

    @Bean
    public RedissonClient redissonClient(){
        Config config = new Config();
        config.useSingleServer()
                .setAddress("redis://10.20.151.73:6379")
               .setPassword("123456");
        return Redisson.create(config);

    }
}
